<?php

namespace app\index\model;

use think\Model;

class Person_info extends Model
{

    public  static function person_info_check(){
        // $k = settype(input('user_name'),"string");   strtoupper
        $user_name = input('user_name');  
        $user_info = self::where(['user_name'=>$user_name])->find();
        if($user_info['user_password'] === input('user_password') ){
           return [1 , $user_info] ;
        }else{
           return [0 , "not found"]  ;
        }
    }

    public static function get_data($data='')
    {
        return self::where($data)->select();
    }

    public static function get_count($data='')
    {
        return self::where($data)->count();
    }

    public static function add_data($data)
    {
        return self::insert($data);
    }

    public static function update_data($data)
    {
        return self::update($data);
    }

     public static function delete_data($data='')
    {
        return self::where($data)->delete();
    }
}